// 月计划列表搜索选项
import SelectOfMonthly from '@/components/Select/SelectOfMonthly'
const searchOption = [
  {
    name: '项目名称',
    value: 'projectName',
    type: 'input'
  },
  {
    name: '项目业态',
    value: 'projectFormat',
    type: 'select',
    data: []
  },
  {
    name: '所属月',
    valueKey: 'belongMonth',
    type: SelectOfMonthly,
    attrs: {
      allowClear: false
    }
  }
]
// 月计划列表表头
const columnsIndex = [
  {
    title: '单位',
    fixed: 'left',
    width: 320,
    dataIndex: 'name',
    ellipsis: true,
    customRender: (text, record) => {
      return text ? text : ''
    }
  },
  {
    title: '项目业态',
    width: 200,
    dataIndex: 'projectFormat',
    customRender: (text, record) => {
      return text ? text : ''
    }
  },
  {
    title: '所属月',
    width: 200,
    dataIndex: 'belongMonth',
    customRender: (text, record) => {
      if (text) {
        return text.replace('-', '年') + '月'
      } else {
        return ''
      }
    }
  },
  {
    title: '节点按时完成率',
    width: 200,
    dataIndex: 'onTimeCompleteRate',
    scopedSlots: { customRender: 'rate' },
  },
  {
    title: '节点完成率',
    width: 200,
    dataIndex: 'completeRate',
    scopedSlots: { customRender: 'rate' },
  },
  {
    title: '状态 ',
    width: 140,
    dataIndex: 'auditStatus',
    scopedSlots: { customRender: 'auditStatus' },
  },
  {
    title: '操作',
    fixed: 'right',
    dataIndex: 'operation',
    width: 170,
    scopedSlots: { customRender: 'operation' },
  }
]
// 状态
const statusMap = {
  '0': { text: '待提交', status: 'warning', },
  '1': { text: '审批中', status: 'processing', },
  '2': { text: '审批通过', status: 'success', },
  '3': { text: '审批不通过', status: 'error', },
}
// 月计划表头
const columnsDetail = [
  {
    title: '编号',
    width: 80,
    align: 'center',
    dataIndex: 'sortNum',
  },
  {
    title: '阶段/类别',
    width: 400,
    dataIndex: 'name'
  },
  {
    title: '业务事项',
    width: 200,
    dataIndex: 'businessMatters'
  },
  {
    title: '管控级别',
    width: 200,
    dataIndex: 'controlLevel'
  },
  {
    title: '周期(天)',
    width: 150,
    dataIndex: 'duration'
  },
  {
    title: '计划开始时间',
    width: 150,
    dataIndex: 'startDate'
  },
  {
    title: '计划完成时间',
    width: 150,
    dataIndex: 'endDate'
  },
  {
    title: '完成标准',
    width: 150,
    dataIndex: 'completeStandard'
  },
  {
    title: '验证资料',
    width: 150,
    dataIndex: 'verifyFiles'
  },
  {
    title: '第一责任人',
    width: 300,
    dataIndex: 'firstResName'
  },
  {
    title: '直接责任人',
    width: 300,
    dataIndex: 'directResPer'
  },
]
// 管控级别
const controlLevelList = [
  {
    value: 1,
    label: '一级节点'
  },
  {
    value: 2,
    label: '二级节点'
  },
  {
    value: 3,
    label: '三级节点'
  }
]
// 完成标准
const completeStandardList = ['验收照片及现场照片', '分包单位合同签订完成,具备进厂配合条件', '验收通过文件']
// 验证资料
const verifyFilesList = ['验收资料扫描件', '合同扫描件', '验收通过文件扫描件']
// 节点信息搜索项
const searchOption1 = [
  {
    name: '业务事项',
    value: 'name',
    type: 'input'
  }
]
// 月计划
const masterPlanList = [
  {
    label: '节点按时完成率',
    value: void 0,
    img: require('@/assets/masterPlan-1.png')
  },
  {
    label: '节点完成率',
    value: void 0,
    img: require('@/assets/masterPlan-2.png')
  },
  {
    label: '逾期一级节点数',
    value: void 0,
    img: require('@/assets/masterPlan-3.png')
  },
  {
    label: '逾期二级节点数',
    value: void 0,
    img: require('@/assets/masterPlan-4.png')
  },
  {
    label: '逾期三级节点数',
    value: void 0,
    img: require('@/assets/masterPlan-5.png')
  },
]
// 历史调整记录表头
const columnsHistoryAdjust = [
  {
    title: '创建时间',
    width: 150,
    dataIndex: 'createTime'
  },
  {
    title: '申请人',
    width: 150,
    dataIndex: 'creatorName'
  },
  {
    title: '调整一级节点个数',
    dataIndex: 'firstAdjustNum'
  },
  {
    title: '调整二级节点个数',
    dataIndex: 'secondAdjustNum'
  },
  {
    title: '调整三级节点个数',
    dataIndex: 'threeAdjustNum'
  },
  {
    title: '附件',
    width: 300,
    dataIndex: 'fileList'
  },
]
// 节点完成表单项
const formOption = [
  {
    label: '工程名称',
    keyName: 'projectName',
    type: 'BaseInput'
  },
  {
    label: '业务事项',
    keyName: 'businessMatters',
    type: 'BaseInput'
  },
  {
    label: '阶段/类别',
    keyName: 'name',
    type: 'BaseInput'
  },
  {
    label: '管控级别',
    keyName: 'controlLevelName',
    type: 'BaseInput'
  },
  {
    label: '周期',
    keyName: 'duration',
    type: 'BaseInput'
  },
  {
    label: '计划开始时间',
    keyName: 'startDate',
    type: 'BaseInput'
  },
  {
    label: '计划完成时间',
    keyName: 'endDate',
    type: 'BaseInput'
  },
  {
    label: '亮灯情况',
    slot: true,
    keyName: 'promptLights'
  },
  {
    label: '节点状态',
    keyName: 'statusName',
    type: 'BaseInput'
  },
  {
    label: '实际完成时间',
    keyName: 'completeDate',
    slot: true,
    type: 'a-date-picker'
  },
  {
    label: '验收资料',
    keyName: 'verifyFiles',
    type: 'BaseTextarea',
    span: 24
  },
  {
    label: '完成标准',
    keyName: 'completeStandard',
    type: 'BaseTextarea',
    span: 24
  },
  {
    label: '第一责任人',
    keyName: 'firstResName',
    type: 'BaseInput'
  },
  {
    label: '直接责任人',
    keyName: 'directResPer',
    type: 'BaseInput'
  },
  {
    label: '节点完成维护人',
    keyName: 'createName',
    type: 'BaseInput'
  },
  {
    label: '节点完成维护时间',
    keyName: 'createTime',
    type: 'BaseInput'
  },
  {
    label: '逾期类别',
    slot: true,
    keyName: 'refList',
    span: 24
  },
  {
    label: '逾期原因',
    keyName: 'delayReason',
    type: 'BaseTextarea',
    span: 24
  },
  {
    label: '备注',
    keyName: 'remarks',
    type: 'BaseTextarea',
    span: 24
  },
]
const formOption1 = [
  {
    label: '劳动力赶工费用(万元)',
    keyName: 'laborResFee',
    type: 'BaseInputNumber',
    precision: 6,
    rules: [{ required: true, message: '请输入劳动力赶工费用(万元)', trigger: 'change' }],
  },
  {
    label: '机械设备赶工费用(万元)',
    keyName: 'equipResFee',
    type: 'BaseInputNumber',
    precision: 6,
    rules: [{ required: true, message: '请输入机械设备赶工费用(万元)', trigger: 'change' }],
  },
  {
    label: '材料赶工费用(万元)',
    keyName: 'materialResFee',
    type: 'BaseInputNumber',
    precision: 6,
    rules: [{ required: true, message: '请输入材料赶工费用(万元)', trigger: 'change' }],
  },
  {
    label: '安全管理赶工费用(万元)',
    keyName: 'safetyMeasureFee',
    type: 'BaseInputNumber',
    precision: 6,
    rules: [{ required: true, message: '请输入安全管理赶工费用(万元)', trigger: 'change' }],
  },
  {
    label: '预计赶工费用(万元)',
    keyName: 'rushFee',
    type: 'BaseInputNumber',
    precision: 6,
    disabled: true
  },
  {
    label: '劳动力资源',
    keyName: 'laborRes',
    type: 'BaseTextarea',
    rules: [{ required: true, message: '请输入劳动力资源', trigger: 'change' }],
    span: 24
  },

  {
    label: '机械设备资源',
    keyName: 'equipRes',
    type: 'BaseTextarea',
    rules: [{ required: true, message: '请输入机械设备资源', trigger: 'change' }],
    span: 24
  },

  {
    label: '材料资源',
    keyName: 'materialRes',
    type: 'BaseTextarea',
    rules: [{ required: true, message: '请输入材料资源', trigger: 'change' }],
    span: 24
  },

  {
    label: '安全管理措施',
    keyName: 'safetyMeasure',
    type: 'BaseTextarea',
    rules: [{ required: true, message: '请输入安全管理措施', trigger: 'change' }],
    span: 24
  }
]
// 复核状态列表
const reviewStatusList = [
  {
    value: -1,
    label: '全部'
  },
  {
    value: 0,
    label: '未复核'
  },
  {
    value: 1,
    label: '复核不通过'
  },
  {
    value: 2,
    label: '复核通过'
  },
]

// 节点状态列表下拉
const nodeStatusList = [
  {
    value: '8',
    label: '待开始'
  },
  {
    value: '7',
    label: '进行中'
  },
  {
    value: '1',
    label: '审批中'
  },
  {
    value: '9',
    label: '逾期未完成'
  },
  {
    value: '2',
    label: '按期完成'
  },
  {
    value: '3',
    label: '逾期完成'
  },
  {
    value: '4',
    label: '审批不通过'
  },
]
// 审批信息表头
const columnApproveCurrent = [
  {
    title: '序号',
    dataIndex: 'serial',
    width: 65,
    scopedSlots: { customRender: 'serial' }
  },
  {
    title: '节点名称',
    dataIndex: 'taskName'
  },
  {
    title: '处理人',
    dataIndex: 'userName',
    scopedSlots: { customRender: 'userName' }
  },
  {
    title: '处理结果',
    dataIndex: 'processStatusName',
    width: 120
  },
  {
    title: '审批意见',
    dataIndex: 'opinions',
    scopedSlots: { customRender: 'opinions' },
    width: 300
  },
  {
    title: '开始时间',
    dataIndex: 'createTime',
    width: 120
  },
  {
    title: '滞留时间',
    dataIndex: 'durationInMillis',
    width: 120
  },
  {
    title: '结束时间',
    dataIndex: 'endTime',
    width: 120
  }
]
const columnApprove = [
  {
    title: '序号',
    dataIndex: 'serial',
    width: 80,
    scopedSlots: { customRender: 'serial' }
  },
  {
    title: '节点名称',
    dataIndex: 'name'
  },

  {
    title: '发起人',
    dataIndex: 'userName'
  },
  {
    title: '发起时间',
    dataIndex: 'startTime'
  },
  {
    title: '滞留时间',
    dataIndex: 'durationTime'
  },
  {
    title: '结束时间',
    dataIndex: 'endTime'
  }
]
const columnApproveDetail = [
  {
    title: '审批人',
    dataIndex: 'userName'
  },
  {
    title: '处理结果',
    dataIndex: 'processStatusName',
    width: 120
  },
  {
    title: '审批时间',
    dataIndex: 'createTime'
  },
  {
    title: '节点名称',
    dataIndex: 'taskName'
  },
  {
    title: '滞留时间',
    dataIndex: 'durationInMillis'
  },
  {
    title: '审批意见',
    dataIndex: 'formData.opinions',
    scopedSlots: { customRender: 'formData.opinions' },
    width: 300
  }
]
export {
  searchOption,
  columnsIndex,
  statusMap,
  columnsDetail,
  controlLevelList,
  completeStandardList,
  verifyFilesList,
  searchOption1,
  masterPlanList,
  columnsHistoryAdjust,
  formOption,
  formOption1,
  reviewStatusList,
  nodeStatusList,
  columnApproveCurrent,
  columnApprove,
  columnApproveDetail
}
